package com.example.springboot.pattern.observer;

/**
 * @Desc
 * @Author houruiyang
 * @Date 2021/11/17
 **/
public class ObserverTest {
    public static void main(String[] args) {
        ConcreteSubject subject = new ConcreteSubject();
        Observer observer1 = new ConcreteObserver("Observer 1", subject);
        Observer observer2 = new ConcreteObserver("Observer 2", subject);

        subject.setState("State 1");
        subject.setState("State 2");
    }
}
